<template>
  <div id="app">
    <!-- 公共头部 -->
    <Header :left="leftBoolean" ref="headerRef"/>
    <!-- 页面级组件占位视图 -->
    <router-view/>
     <Footer v-show="$route.meta.requiresAuth" />
  </div>
</template>
<script>
import Header from "@/components/Header.vue"
import Footer from "@/components/Footer.vue"
export default {
  data(){
    return{
      leftBoolean:false
    }
  },
   methods:{
    appClick(){
      this.$refs.headerRef.menuBoolean = false
    },
  },
  watch: {
    "$route.path": function(newVal) {
      // console.log(newVal, oldVal);
      if (newVal == "/" || newVal == "/Community" || newVal == "/My") {
        this.leftBoolean = false;
      } else {
        this.leftBoolean = true;
      }
    },
  },
  components:{
    Header,
    Footer
  },
}
</script>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
}

</style>
